﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Net;

namespace System.WebControls
{
    [DefaultProperty("Text")]
    [ToolboxData("<{0}:DateTimeLong runat=server></{0}:DateTimeLong>")]

    public class DateTimeLong : CompositeControl
    {
            [Bindable(true)]
            [Category("Appearance")]
            [DefaultValue("")]
            [Localizable(true)]

            protected Label Label1;
            protected Label Label2;
            string SLDateTime;
            string SLDateTime2;

            protected override void CreateChildControls()
            {
                base.CreateChildControls();
                Label1 = new Label();
                Label2 = new Label();
                SLDateTime = System.DateTime.Today.DayOfWeek.ToString();
                SLDateTime2 = System.DateTime.Now.ToString("MMMM.dd.yyyy h:m.s tt");                
                Label1.Text = SLDateTime;
                Label2.Text = SLDateTime2;
                Controls.Add(Label1);
                Controls.Add(new LiteralControl("&nbsp;"));
                Controls.Add(new LiteralControl("&nbsp;"));
                Controls.Add(Label2);

            }
        
    }
}
